package dhbw.GUI.TableModels;

import java.awt.Color;

import javax.swing.table.DefaultTableCellRenderer;

import dhbw.Data.Settings;

public class TableRendererNoten extends DefaultTableCellRenderer {

	@Override
	/**
	 * Renders the data tables, will mark each Cell red, if there is an integer <50
	 */
	protected void setValue(Object value) {
		super.setValue(value);
		int myvalue = -1;
		setBackground(Settings.BG_COLOR);
		setForeground(Settings.COLOR);
		try {
			myvalue = Integer.parseInt(value.toString());
			if ((myvalue < 50) && (myvalue > -1)) {
				setBackground(Color.RED);
			}
		} catch (Exception ex) {
		}
	}
}